<?php

namespace App\Http\Controllers;


use App\Models\Communities;
use App\Models\District;
use Illuminate\Http\Request;

class CitiesController extends Controller
{
    public function index(Request $request)
    {
        return view('cities.index');
    }

    public function select(Request $request)
    {
        $community_id = $request->id;
        $cookie       = cookie('community_id', $community_id);
        return redirect()->intended()->cookie($cookie);
    }

    public function all()
    {
        $cookie = cookie('community_id', null);
        return redirect()->intended()->cookie($cookie);
    }
}
